const app = getApp()
import req from '../../utils/Request.js';
import appReq from '../../utils/AppRequest.js';
var WxParse = require('../../utils/wxParse/wxParse.js');
Page({
  data: {
    keyId: "",
    list: null,
  },

  onLoad: function (value) {
    this.setData({
      keyId: value.keyId,
    })
    this.getDetail()
  },

  getDetail: function () {
    req.get('/index/housesDetail.do', { housesId: this.data.keyId }).then(res => {
      if (res.code == 1) {
        this.setData({
          list: res.data,
        })
        WxParse.wxParse('article', 'html', this.data.list.summarize, this, 0);
        wx.hideLoading();
      } else {
        app.showErrorMessage(res, '加载失败');
        wx.hideLoading();
        return;
      }
    }).catch(res => {
      wx.hideLoading();
      wx.showToast({
        title: '网络异常',
        icon: 'none'
      });
      console.log(res);
    });
  },


})